#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define NUMBER	500000
#define FORZ(i, max)	for(i = 0; i < max; i++)
#define SUM(n) ((n)*((n)+1ll)/2ll)
#define MXK 8

unsigned char *T[2][9]={
{//a=2 k=1
"0 1 5 6",//a=2 k=2
"0 1 25 76",//a=2 k=3
"0 1 376 625",//a=2 k=4
"0 1 625 9376",//a=2 k=5
"0 1 9376 90625",//a=2 k=6
"0 1 109376 890625",//a=2 k=7
"0 1 2890625 7109376",//a=2 k=8
"0 1 12890625 87109376",//a=2 k=9
"0 1 212890625 787109376"},
{//a=3 k=1
"0 1 4 5 6 9",//a=3 k=2
"0 1 24 25 49 51 75 76 99",//a=3 k=3
"0 1 125 249 251 375 376 499 501 624 625 749 751 875 999",//a=3 k=4
"0 1 624 625 1249 3751 4375 4999 5001 5625 6249 8751 9375 9376 9999",//a=3 k=5
"0 1 9375 9376 18751 31249 40625 49999 50001 59375 68751 81249 90624 90625 99999",//a=3 k=6
"0 1 109375 109376 218751 281249 390625 499999 500001 609375 718751 781249 890624 890625 999999",//a=3 k=7
"0 1 781249 2109375 2890624 2890625 4218751 4999999 5000001 5781249 7109375 7109376 7890625 9218751 9999999",//a=3 k=8
"0 1 12890624 12890625 24218751 25781249 37109375 49999999 50000001 62890625 74218751 75781249 87109375 87109376 99999999",//a=3 k=9
"0 1 74218751 212890624 212890625 287109375 425781249 499999999 500000001 574218751 712890625 787109375 787109376 925781249 999999999"}
};

typedef long long int ll;
typedef unsigned long long int ull;
typedef unsigned int uint;

int main() {
	uint a,k;
	scanf("%d %d",&k,&a);
	printf("%s\n",T[a-2][k-1]);
	return 0;
}
